#ifndef __WINGBOT_QUEUE_H
#define __WINGBOT_QUEUE_H    

#ifdef __cplusplus
 extern "C" {
#endif

/* 队列控制块 */
typedef struct QUEUE{
    unsigned char* parr;
    unsigned int head;
    unsigned int tail;  //指向下次接收时存储的位置
    unsigned char isFull;
    unsigned int size;  //实际有效长度为size-1
    unsigned int length;
}Queue_T;

void queue_init(Queue_T* p_queue, unsigned char* p_arr, unsigned int size);
void queue_clear(Queue_T* p_queue);
void queue_push(Queue_T* p_queue, unsigned char data);
int queue_read(Queue_T* p_queue, unsigned char* dest, unsigned int length);

#ifdef __cplusplus
 }
#endif

#endif
 
/*****END OF FILE****/
